package cs348a.test.pilot;

public abstract class AbstractPilot implements Pilot {
	
	protected PilotListener listener = null;
	
	protected float[] currentPoint;

	protected int zOffset = DEFAULT_Z;
	
	protected int timeInterval = 100;
	
	/** is looking down */
	protected boolean isLookingDown = false;
	
	/**
	 * Returns current position
	 */
	public float[] getCurrentPosition() {
		return currentPoint;
	}
	
	public int getZOffset() {
		return zOffset;
	}
	
	/**
	 * Sets the time interval
	 * 
	 * @param inMilliSec
	 */
	public void setTimeInterval(int inMilliSec) {
		timeInterval = inMilliSec;
	}
	
	/**
	 * Sets the z value
	 */
	public void setZOffset(int z) {
		if(z < 0) z = 0;
		zOffset = z;
	}

	public void setMode(boolean lookDown) {
		isLookingDown = lookDown;
	}
	
	public boolean isLookingDown() {
		return isLookingDown;
	}
	
	/**
	 * Sets a pilot listener
	 * @param pl
	 */
	public void setPilotListener(PilotListener pl) {
		listener = pl;
	}
	
	protected void fireChanged(float[] p) {
		listener.pilotChanged(p);
	}
}
